<?php 
require_once("Elements.php");

class AddInvitationUserList extends Zend_Form {
	
	private $invitation_id;
	private $userList;
	
	/**
	 * Constructor.
	 * 
	 * @param $invitation_id
	 * @param $userList user list by given invitation
	 */
	public function AddInvitationUserList($invitation_id, $userList) {
		$this->invitation_id = $invitation_id;
		$this->userList = $userList;
		$this->__construct();
	}
	
	public function init() {
		$elements = new Elements();
		$this->setAttrib('id','addUserList');
		$this->setMethod('post');
		
		$element = new Zend_Form_Element_Hidden("iid");
		$element->setValue($this->invitation_id);
		$this->addElement($element);
		
		// invitation user list
		$element = $elements->getInvitationUsersTextareaField($this->userList);
		$this->addElement($element);
		
		
		$element = new Zend_Form_Element_Submit("SaveAndSend");
		$element->setLabel('Save And Send')->removeDecorator('DtDdWrapper');
		$element->setValue(1);
		$this->addElement($element);
		
		$element = new Zend_Form_Element_Submit("Save");
		$element->setLabel('Save')->removeDecorator('DtDdWrapper');
		$element->setValue(0);
		$this->addElement($element);
	}
}
?>